import React, { Component } from 'react'

import { NavBar, Icon } from 'antd-mobile'

import { Container } from './style'

class TopNavBar extends Component {
  render() {
    return (
      <Container>
        <NavBar
          className="navbar"
          mode="light"
          rightContent={[
            <Icon
              onClick={() => {
                console.log(123)
              }}
              key="0"
              type="search"
              style={{ marginRight: '16px', color: 'white' }}
            />
          ]}
        >
          {this.props.title}
        </NavBar>
      </Container>
    )
  }
}

TopNavBar.defaultProps = {
  title: '导航'
}

export default TopNavBar
